package com.codeforces.contest.c292;
import java.util.Scanner;


public class _292B {

	static Scanner scanner = new Scanner(System.in);
	static int n, m, a, b;
	static int[] deg;
	static int[] co = new int[3];

	public static void main(String[] args) {
		n = scanner.nextInt();
		m = scanner.nextInt();
		deg = new int[n+1];
		for (int i=1;i<=m;++i) {
			a = scanner.nextInt();
			b = scanner.nextInt();
			deg[a]++;
			deg[b]++;
		}
		for (int i=1;i<=n;++i) {
			if (deg[i] == 1) {
				co[0]++;
			}
			else if (deg[i] == 2) {
				co[1]++;
			}
			else if (deg[i] == n-1) {
				co[2]++;
			}
		}
		if (co[1] == n) {
			System.out.println("ring topology");
		}
		else if (co[1] == n-2 && co[0] == 2) {
			System.out.println("bus topology");
		}
		else if (co[0] == n-1 && co[2] == 1) {
			System.out.println("star topology");
		}
		else {
			System.out.println("unknown topology");
		}
	}

}
